/*
 * // Bristleback plugin - Copyright (c) 2010 bristleback.googlecode.com
 * // ---------------------------------------------------------------------------
 * // This program is free software; you can redistribute it and/or modify it
 * // under the terms of the GNU Lesser General Public License as published by the
 * // Free Software Foundation; either version 3 of the License, or (at your
 * // option) any later version.
 * // This library is distributed in the hope that it will be useful,
 * // but without any warranty; without even the implied warranty of merchantability
 * // or fitness for a particular purpose.
 * // You should have received a copy of the GNU Lesser General Public License along
 * // with this program; if not, see <http://www.gnu.org/licenses/lgpl.html>.
 * // ---------------------------------------------------------------------------
 */

package pl.bristleback.server.bristle.binding.resolvers;

/**
 * Classes implementing this interface resolve value of determined type.
 * It is required for every implementation to return null instead of throwing exception in case when extracting value fails.
 * There is default resolver for every raw type.
 * Default property value resolvers may be overridden in {@link pl.bristleback.server.bristle.binding.Property} annotations.
 * <p/>
 * Created on: 2011-02-23 15:39:49 <br/>
 *
 * @author Wojciech Niemiec
 */
public interface PropertyValueResolver<T> {

  /**
   * Extracts value given as parameter and process it to be of desired type.
   *
   * @param value value to extract.
   * @return processed value or <code>null</code> if given value cannot be processed.
   */
  T extractValue(Object value);
}
